package com.scgk.sync.common.exception;
import com.scgk.sync.common.ErrorType;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * description: 业务异常
 * date: 2021-08-07 16:20
 * @author: xdchen12
 * version: 1.0
 */
@Data
@NoArgsConstructor
public class BusinessException extends BaseException {

    private String code = ErrorType.ERROR_BUSINESS.getCode();

    public BusinessException(String code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(ErrorType errorType) {
        super(errorType.getMsg());
        this.code = errorType.getCode();
    }
}
